﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonsterEngine.Interfaces;
using MonsterEngine.Managers;

namespace MonsterEngine.Augments
{
    public class MissTurn:IAugmentable
    {
        public event WornOffHandler WornOff;

        private int _effectiveTurnCount = 3;
        public int EffectiveTurnCount
        {
            get { return _effectiveTurnCount; }
        }
        private int _currentTurnCount;
        public int CurrentTurnCount
        {
            get
            {
                return _currentTurnCount;
            }
            set
            {
                _currentTurnCount = value;
            }
        }

        public void ExecuteAugment()
        {
            if (_currentTurnCount == _effectiveTurnCount)
            {
                PlayerManager.Player1.isActive = true;
                _currentTurnCount = 0;
                PlayerManager.Player1.BuffList.Remove(this);
                if (WornOff != null)
                {
                    WornOff();
                }
                return;
            }
            Console.WriteLine("{0} is out cold!", PlayerManager.Player1.Name);
            Console.WriteLine(String.Empty);
            PlayerManager.Player1.isActive = false;
            _currentTurnCount++;
        }
    }
}
